SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO


CREATE PROCEDURE dbo.[DnnProduct_Journal_GetStatsForGroup]
@PortalId int,
@GroupId int
AS
SELECT Count(j.JournalTypeId) as JournalTypeCount, jt.JournalType from dbo.[DnnProduct_Journal] as j 
	INNER JOIN dbo.[DnnProduct_Journal_Types] as jt ON jt.JournalTypeId = j.JournalTypeId
WHERE j.GroupId = @GroupId AND j.PortalId = @PortalId
Group BY j.JournalTypeId, jt.JournalType

GO
